Conversation
Create composite action that automatically generates and pushes git tags using the current date and time in YYYY-MM-DD.HH-MM format.
- Add 'tag' output to expose created tag name - Add CI workflow to test action functionality - Verify tag creation both locally and on remote
- Add CD workflow for automated releases on version tags - Switch CI runner from ubuntu-latest to ubuntu-slim
There was a problem hiding this comment.
Pull request overview
This PR introduces a GitHub Action that creates and pushes datetime-based git tags, along with CI/CD workflows for testing and releasing the action.
Key Changes:
- Implements a composite GitHub Action that generates tags in the format
YYYY-MM-DD.HH-MMbased on current date/time - Adds CI workflow to test the action's functionality by verifying tag creation and push operations
- Adds CD workflow to create GitHub releases when version tags are pushed
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| action.yml | Defines the composite action that creates datetime-based tags with git configuration and push logic |
| README.md | Updates project name and adds basic description of the action's functionality |
| .github/workflows/ci.yml | Implements automated testing workflow that validates tag creation and remote push |
| .github/workflows/cd.yml | Implements release automation workflow triggered by version tags |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| git tag -a "$TAG" -m "Auto-generated tag for $TAG" | ||
| git push origin "$TAG" | ||
| echo "Tag $TAG created and pushed successfully!" |
There was a problem hiding this comment.
The action does not handle the case where a tag with the same name already exists. If the action runs twice within the same minute, the 'git tag' command will fail because the tag already exists. Consider adding error handling or checking if the tag exists before creating it, or appending seconds to the timestamp to reduce collision likelihood.
| git tag -a "$TAG" -m "Auto-generated tag for $TAG" | |
| git push origin "$TAG" | |
| echo "Tag $TAG created and pushed successfully!" | |
| if git rev-parse --verify --quiet "refs/tags/$TAG" >/dev/null; then | |
| echo "Tag $TAG already exists. Skipping creation and push." | |
| else | |
| git tag -a "$TAG" -m "Auto-generated tag for $TAG" | |
| git push origin "$TAG" | |
| echo "Tag $TAG created and pushed successfully!" | |
| fi |
| git tag -a "$TAG" -m "Auto-generated tag for $TAG" | ||
| git push origin "$TAG" |
There was a problem hiding this comment.
The action will fail if it doesn't have permissions to push to the repository. The composite action runs in the context of the calling workflow, which means the workflow needs to grant 'contents: write' permission. Consider adding a note in the action description or README about this requirement, or add error handling to provide a clearer message when the push fails due to insufficient permissions.
|
|
||
| on: | ||
| - push | ||
|
|
There was a problem hiding this comment.
The CI workflow does not set 'contents: write' permission, which is required for the action to push tags to the repository. Without this permission, the git push command in the action will fail. Add a 'permissions' section with 'contents: write' to this workflow, similar to what's done in the CD workflow.
| permissions: | |
| contents: write |
No description provided.